#ifndef TODOITEM_H
#define TODOITEM_H

#include <QDate>
#include <QString>
#include <QVector>

class TodoItem
{
public:
    TodoItem();
    TodoItem(int code, int priority, QString description, bool urgent, QDate date, bool complete);
    TodoItem(QString code, QString priority, QString description, QString urgent, QString date, QString complete);
    TodoItem(int priority, QString description, bool urgent, QDate date = QDate::currentDate(), bool complete = false);

    static int propCount() { return 6; }
    //QString toString();
    //QString toFormattedString();

    QString priorityToString();
    QString dateToString();

protected:
    bool _stringToBool(const QString &s);
    int _stringToInt(const QString &s);
    int _stringToPriority(const QString &s);
    QDate _stringToDate(const QString &s);

public:
    int code = -1;
    bool urgent = false;
    QString description;
    int priority = -1;
    QDate date = QDate::currentDate();
    bool complete = false;

};

typedef QSharedPointer<TodoItem> TodoItemPtr;

#endif // TODOITEM_H
